package com.sw.youvote.shared.objects;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


/* 03/07/2010 Adolfo
 * Cambio de nombre de clase a�adido sufijo Bean
 * A�adido campo imagen para la caratula 
 * en:
 * variables de instancia
 * parametro de constructor
 * asignacion de valor en constructor
 * nuevo metodo get
 * nuevo metodo set
 */

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class QuizBean implements Serializable {

	private static final long serialVersionUID = 1L;
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private String name;
	@Persistent
	private String description;
	@Persistent
	private String creatormail;
	@Persistent
	private String imageurl;
		@Persistent
	private List<CandidatureBean> candidatureSets;
	
	public QuizBean() {
		this.candidatureSets = new ArrayList();
	}

	public QuizBean(String name, String description, String creatormail, String imageurl) {
		super();
		this.name = name;
		this.description = description;
		this.creatormail = creatormail;
		this.imageurl = imageurl;

	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getDescription() {
		return description;
	}
	
	public String getImageurl() {
		return imageurl;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getCreatorMail() {
		return creatormail;
	}

	public void setCreatorMail(String creatormail) {
		this.creatormail = creatormail;
	}
	public void setImageurl(String imageurl){
		this.imageurl = imageurl;
	}
	
	public List<CandidatureBean> getCandidatureSets() {
		return candidatureSets;
	}

	public void setCandidatureSets(List<CandidatureBean> candidatureSets) {
		this.candidatureSets = candidatureSets;
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		
		sb.append("[");
		sb.append("id");
		sb.append("=");
		sb.append(this.id);
		sb.append(",");
		sb.append("name");
		sb.append("=");
		sb.append(this.name);
		sb.append(",");
		sb.append("description");
		sb.append("=");
		sb.append(this.description);
		sb.append(",");
		sb.append("creatormail");
		sb.append("=");
		sb.append(this.creatormail);
		sb.append(",");
		sb.append("imageurl");
		sb.append("=");
		sb.append(this.imageurl);
		sb.append(",");
		sb.append("Candidaturas");
		sb.append("=");
		sb.append(this.candidatureSets);
		
		sb.append("]");
		return sb.toString();
	}
	
}

